#ifndef ICMP_H 
#define ICMP_H
#include <netinet/in.h>
// 计算 ICMP 校验和
unsigned short checksum(unsigned short *buf, int len);

// 接收 ICMP Echo Reply
int receive_icmp_reply(int sockfd, struct sockaddr_in *dest_addr, int seq);

// 发送 ICMP Echo Request
void send_icmp_echo_request(int sockfd, struct sockaddr_in *dest_addr, int seq);

//检查主机是否在线
void icmpEcho(char* ip);

#endif